package cuit.cx.groupcomment.dao.impl;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import cuit.cx.groupcomment.dao.CommentDAO;
import cuit.cx.groupcomment.model.Comment;

public class CommentDAOImpl extends SqlMapClientDaoSupport implements CommentDAO {

    public CommentDAOImpl() {
        super();
    }

   
    public void addComment(Comment record) {
        getSqlMapClientTemplate().insert("addComment", record);
    }

    public int updateComment(Comment record) {
        int rows = getSqlMapClientTemplate().update("updateComment", record);
        return rows;
    }

    public Comment findCommentById(Integer id) {
        Comment record = (Comment) getSqlMapClientTemplate().queryForObject("getCommentById", id);
        return record;
    }

    public int deleteComment(Integer id) 
    {
        int rows = getSqlMapClientTemplate().delete("delelteComment", id);
        return rows;
    }

    
    
}